/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package Entidades;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Daniel
 */
@Entity
@Table(name = "entradas")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Entradas.findAll", query = "SELECT e FROM Entradas e"),
    @NamedQuery(name = "Entradas.findById", query = "SELECT e FROM Entradas e WHERE e.id = :id"),
    @NamedQuery(name = "Entradas.findByCliente", query = "SELECT e FROM Entradas e WHERE e.cliente = :cliente"),
    @NamedQuery(name = "Entradas.findByDias", query = "SELECT e FROM Entradas e WHERE e.dias = :dias"),
    @NamedQuery(name = "Entradas.findByFecha", query = "SELECT e FROM Entradas e WHERE e.fecha = :fecha")})
public class Entradas implements Serializable {
    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private BigDecimal id;
    @Size(max = 50)
    @Column(name = "cliente")
    private String cliente;
    @Size(max = 100)
    @Column(name = "dias")
    private String dias;
    @Column(name = "fecha")
    @Temporal(TemporalType.DATE)
    private Date fecha;

    public Entradas() {
    }
/**
     * Metodo accesor 
     *
     * @return
     */
    public Entradas(BigDecimal id) {
        this.id = id;
    }
/**
     * Metodo accesor 
     *
     * @return
     */
    public BigDecimal getId() {
        return id;
    }
/**
     * Metodo accesor 
     *
     * @return
     */
    public void setId(BigDecimal id) {
        this.id = id;
    }
/**
     * Metodo accesor 
     *
     * @return
     */
    public String getCliente() {
        return cliente;
    }
/**
     * Metodo accesor 
     *
     * @return
     */
    public void setCliente(String cliente) {
        this.cliente = cliente;
    }
/**
     * Metodo accesor 
     *
     * @return
     */
    public String getDias() {
        return dias;
    }
/**
     * Metodo accesor 
     *
     * @return
     */
    public void setDias(String dias) {
        this.dias = dias;
    }
/**
     * Metodo accesor 
     *
     * @return
     */
    public Date getFecha() {
        return fecha;
    }
/**
     * Metodo accesor 
     *
     * @return
     */
    public void setFecha(Date fecha) {
        this.fecha = fecha;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Entradas)) {
            return false;
        }
        Entradas other = (Entradas) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entidades.Entradas[ id=" + id + " ]";
    }
    
}
